package com.bsoft.advance.core.serialization;

public class SerializationFactory {
    public static Serialization getDefaultSerialization(){
        return new HessianSerialization();
    }

    public static Serialization getSerialization(SerializationType type) {
        switch (type) {
            case HESSIAN:
                return new HessianSerialization();
            case HESSIAN2:
                return new Hessian2Serialization();
            case JSON:
                return new JsonSerialization();
            case KRYO:
                return new KryoSerialization();
            case FST:
                return new FSTSerialization();
            case JDK:
                return new JDKSerialization();
            case PROTOSTUFF:
                return new ProtostuffSerialization();
            default:
                throw new IllegalArgumentException("未识别的序列化方式");
        }
    }
}
